<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>分店管理-设置</title>
	<link rel="stylesheet" href="/js/plugin/layui-v2.3.0/layui/css/layui.css">
	<link rel="stylesheet" href="/css/reset.css">
	<link rel="stylesheet" href="/css/index.css">
	<link rel="stylesheet" href="/css/project_set.css">
	<script src="/js/jquery-2.1.1.min.js"></script>
	<script src="/js/plugin/layui-v2.3.0/layui/layui.js"></script>
</head>
<style>
::-webkit-scrollbar {
    width: 6px;
     height: 6px;
    background-color: #F5F5F5;
    cursor: pointer;
}
::-webkit-scrollbar-thumb {
    background-color: #a2a2a2;
    border-radius: 2px;
}
/* ::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    background-color: #ffffff;
} */ 
body{
	overflow-y: scroll;
} 
</style>
<body>
<div class="kb-out-box">
	<div class="kb-content my-locations-list">	
		<div class="nav-container f-left">
			<div class="nav-container-content">
				<header class="nav-header">
					<h2 class="header-title">分店设置</h2>
				</header>
				<div class="nav-body" id="nav-side">
					<ul class="nav-container-list">
						<li data-src="setBasic" class=""><a href="javascript:void(0)">基本设置</a></li>
						<li data-src="setPower"><a href="javascript:void(0)">权限设置</a></li>
						<li data-src="setRoom"><a href="javascript:void(0)">会议室设置</a></li>
						<li data-src="finance"><a href="javascript:void(0)">财务设置</a></li>
						<li data-src="setFloor"><a href="javascript:void(0)">楼层管理</a></li>
						<li data-src=""><a href="javascript:void(0)">微信小程序设置</a></li>
						<li data-src="logList"><a href="javascript:void(0)">操作日志</a></li>
					</ul>
				</div>
			</div>
		</div>	
		<div class="nav-section-container nav-section-container-bg f-right">
			<div style="width: 100%;min-height: 100%; position: relative;" id="iframeSet-wrap">
				<iframe id="iframeSet" src="" frameborder="0" width="100%" height="100%" scroll='no'></iframe>
			</div>
		</div>	
	</div>
</div>
</body>
<script>
var id=parent.$("#projectId").val();
$(function(){
	layui.use(['element',"layer","form"], function(){
		var layer=layui.layer,form = layui.form;
	});
	getIframeSetHash()
	//设置侧边切换
	$("#nav-side").on("click","li",function(){
		
		var dataSrc=$(this).attr("data-src"),src='/app/project/'+dataSrc+'/'+id;
		location.hash='#'+dataSrc;
		getIframeSetHash()
		
	})
})	
//匹配此页面的iframe的hash，给src赋值；
function getIframeSetHash(){
	var layid = location.hash.substr(1),iframeSrc="",hashId='';
	$("#nav-side li").removeClass("nav-container-list-hover")
	if(layid==""||layid=='undefined'||layid==null||layid=='setBasic'){//首次进来，分店管理
		iframeSrc='/app/project/setBasic/'+id;
		layid='setBasic';
		//location.hash = 'setBasic';
	}
	if(layid=='setPower'){
		iframeSrc='/app/project/setPower';
	}else if(layid=='setFloor'){
		iframeSrc='/app/project/setFloor/'+id;
	}else if(layid=='setRoom'){
		iframeSrc='/app/project/setRoomset/'+id;
	}else if(layid=='setPos'){
		iframeSrc='/app/project/setPosset/'+id;
	}else if(layid == 'finance'){//财务设置
		iframeSrc = '/app/finance/financeSet';
	}else if(layid == 'logList'){//操作日志
		iframeSrc = '/app/log/list';
	}
	$("#nav-side li[data-src='"+layid+"']").addClass("nav-container-list-hover");
    var iframe = document.createElement('iframe');//动态创建iframe，禁止iframe的src回退；
    iframe.src = iframeSrc;
    iframe.width = '100%';
    iframe.height = '100%';
    $("#iframeSet-wrap").html($(iframe));
	//$("#project-iframe").attr("src",iframeSrc);	
}
	
//手动设置iframe容器的高度
function setiframeWrap(h){
   document.getElementById("iframeSet-wrap").style.height = h+"px"
}
</script>
</html>